import {Clazz} from "./Clazz";
import * as THREE from 'three';

import {ThreeMFLoader} from 'three/examples/jsm/loaders/3MFLoader.js';

class PushCar extends Clazz {
    constructor(scene, camera, renderer) {
        super();
        const manager = new THREE.LoadingManager();
        this.loader = new ThreeMFLoader(manager);
        this.loader.load('../js/components/images/pushcar/truck.3mf', function (object) {
            object.rotation.set(-Math.PI / 2, 0, Math.PI / 4); // z-up conversion
            object.position.y = -340;
            object.position.z = -640;
            object.position.x = 2440;
            object.scale.set(30, 30, 30);
            object.traverse(function (child) {
                child.castShadow = true;
            });
            scene.add(object);

        });

        //

        manager.onLoad = function () {

            renderer.render(scene, camera);

        };
    }

    update() {
        super.update();
    }
}

export {PushCar}